package com.whcoding.easyexcel.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.whcoding.easyexcel.converter.DeptTypeConverter;
import lombok.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
//链式写法
//@Accessors(chain = true)
@EqualsAndHashCode
@ToString
public class OrmDeptExcelVO implements Serializable {

	private Long id;

	@ExcelProperty("部门ID")
	@ColumnWidth(10)
	private Integer deptId;

	@ExcelProperty("部门编码")
	@ColumnWidth(20)
	private String deptNo;

	@ExcelProperty(value = "部门类型", converter = DeptTypeConverter.class)
	@ColumnWidth(10)
	private Integer deptType;

	@ExcelProperty("部门名称")
	@ColumnWidth(20)
	private String deptName;

	@ExcelProperty("创建日期")
	@ColumnWidth(20)
	@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
//	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;

	@ExcelProperty("修改日期")
	@ColumnWidth(20)
	@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
//	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date updateTime;


	@ExcelProperty("金额")
	@ColumnWidth(20)
	private BigDecimal deptPerf;

	@ExcelIgnore
	private Integer isValidFlag;

	@ExcelProperty("短名称")
	@ColumnWidth(20)
	private String shortName;

	@ExcelIgnore
	private String remark;
}
